package com.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.NoticeMapper;
import com.pojo.Notice;
import com.service.NoticeService;
import com.vo.NoticeVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NoticeServiceimpl implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;
    @Override
    public PageInfo<Notice> selectnoticeall(NoticeVo noticeVo) {
        PageHelper.startPage(noticeVo.getPage(),noticeVo.getLimit());
        List<Notice> selectnoticeall = noticeMapper.selectnoticeall(noticeVo);
        PageInfo<Notice> pageInfo=new PageInfo<>(selectnoticeall);

        return pageInfo;
    }

    @Override
    public int updateByPrimaryKeySelective(Notice record) {
        int i = noticeMapper.updateByPrimaryKeySelective(record);
        return i;
    }

    @Override
    public int insertSelective(Notice record) {
        int i = noticeMapper.insertSelective(record);
        return i;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        int i = noticeMapper.deleteByPrimaryKey(id);
        return i;
    }

    @Override
    public List<Notice> selectbytennotice() {
        List<Notice> selectbytennotice = noticeMapper.selectbytennotice();
        return selectbytennotice;
    }

}
